<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
try{
	if(null==request.getSession().getAttribute("userInfo")){
	    out.print("<script>window.location.href='../web/login/login.jsp'</script>");
	}
}catch(Exception e)
{
    out.print("<script>window.location.href='../web/login/login.jsp'</script>");
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script type="text/javascript" src="<%=basePath%>scripts/jquery-1.4.2.js">	</script>
<script type="text/javascript" src="<%=basePath%>web/register/register.js">	</script>
<script type="text/javascript" src="<%=basePath%>scripts/cookie.js"></script>
<title>会员信息修改</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FDFDFD;
}
img { border:0}
p {
	margin: 0px;
	padding: 0px;
}
form,input,td,th{ 
border:medium none;
margin: 0;
padding: 0;
} 
ul,li {
	margin: 0px;
	padding: 0px;
	list-style-type: none;
}
input {
	border:0;
	padding:0
}
.logset {
	background-image: url(../web/resources/images/index-search_02.jpg);
	background-repeat: repeat-x;
	height: 32px;
	width: auto;
	line-height: 32px;
}
.logset a {
	font-size: 13px;
	color: #3399cc;
	display: inline-block;
	float: right;
	margin-right: 30px;
}
.content {
	background-image: url(../web/resources/images/findCipher_04.png);
	height: 111px;
	background-color: #F9F9F9;
	padding-top: 0px;
	background-repeat: repeat-x;
	padding-left: 30px;
}
.content #search {
	width: 784px;
	height: 41px;
	overflow: hidden;
}
.s_t_wr{
	width:634px;
	height:41px;
	margin-right:8px;
	background-image: url(../web/resources/images/search-list_06.gif);
	background-repeat: no-repeat;
	float: left;
	padding: 0px;
	background-position: left top;
}
.s_t{
	width:595px;
	height:35px;
	outline:none;
	-webkit-appearance:none;
	font-family: "宋体";
	font-size: 14px;
	line-height: 35px;
	margin-top: 0px;
	margin-right: 0;
	margin-bottom: 0;
	margin-left: 34px;
	background-image: url(../web/resources/images/search-list_06-bg.gif);
	color: #999;
	background-repeat: repeat-x;
	background-position: left 0px;
	border-top-width: 0px;
	border-right-width: 0px;
	border-bottom-width: 0px;
	border-left-width: 0px;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
	padding-top: 5px;
	padding-right: 0px;
	padding-bottom: 5px;
	padding-left: 0px;
}
.s_btn_wr{
	width:142px;
	height:41px;
*position:relative;				z-index:0;
	background-image: url(../web/resources/images/search-list_08.gif);
	background-repeat: no-repeat;
	float: left;
}
.s_btn{
	width:142px;
	height:41px;
	font-size:0px;
	cursor:pointer;
	background-color: #ddd;
	background-image: url(../web/resources/images/search-list_08.gif);
	text-decoration: none;
	color: #E4E4E4;
}
.content .but123 {
	float: right;
	display: block;
	height: 41px;
	width: 441px;
	margin-top: 68px;
}
.content .but123 a {
	float: left;
	font-size: 14px;
	color: #3399cc;
	font-weight: bold;
	font-family: "宋体";
	line-height: 41px;
	height: 41px;
	display: inline-block;
	width: 100px;
	text-align: left;
	padding-left: 47px;
	text-decoration: none;
}
.content .but123 .but1 {
	background-image: url(../web/resources/images/search-list_10.gif);
	background-repeat: no-repeat;
	background-position: left top;
}
.content .but123 .but2 {
	background-image: url(../web/resources/images/search-list_12.gif);
	background-repeat: no-repeat;
	background-position: left top;
}
.content .but123 .but3 {
	background-image: url(../web/resources/images/search-list_14.gif);
	background-repeat: no-repeat;
	background-position: left top;
}
.foot {
	background-image: url(../web/resources/images/index-search_25.jpg);
	background-repeat: repeat-x;
	background-position: center top;
	height: 150px;
	background-color: #F9F9F9;
	text-align: center;
	padding-top: 39px;
	line-height: 24px;
	font-size: 13px;
	color: #999;
}
.foot p a {
	color: #999;
}
-->


</style>
<script>
var basePath = '<%=basePath%>';
function settab_zzjsnet(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var zzjs=document.getElementById("zzjs_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  zzjs.style.display=i==cursel?"block":"none";
 }
}

function bigCategoryChange(){
	var bigCategoryValue = $("#bigCategory option:selected").val();
	if(bigCategoryValue != ""){
		$('#smallCategory').html('加载中... ...');
		$.get(basePath+'member/loadCityByPid.action?id='+bigCategoryValue+'&t='+new Date().getTime().toString(36),function(mes){
			var json = eval('('+mes+')');
			var str = '<select id="districtIdsel" onchange="changeV(this.value)"><option value="">--请选择--</option>';
			for(var i = 0; i < json.length; i++){
				str += '<option value="'+json[i]['id']+'">'+json[i]['name']+'</option>';
			}
			str+='</select>';
			$("#districtId").val('');
			$('#smallCategory').html(str);
		})
	}
}

//验证提交
function checkSubmit1(){
  var  phone = $("#phone");
  if(phone.val().trim().length==0)
  {
     alert("请输入手机号码!");
     phone.focus();
     return;
  }
  var phoneRegex = /1([0-9]){10}/
  if(!phoneRegex.test(phone.val().trim()))
  {
       alert("手机号码输入格式错误!");
       phone.focus();
       return;
  }
  var  districtId = $("#districtId");
  if(districtId.val().trim().length==0)
  {
     alert("请选择所在城市!");
     $("#districtIdsel").focus();
     return;
  }
  
  var  idcard = $("#idcard");
  if(idcard.val().trim().length==0)
  {
     alert("请输入身份证!");
     idcard.focus();
     return;
  }
  var checkcodeRegex = /(^\d{15}$)|(^\d{17}(\d|X)$)/;
  if(!checkcodeRegex.test(idcard.val().trim()))
  {
       alert("身份证输入格式错误!");
       idcard.focus();
       return;
  }
  var  code = $("#code");
  if(code.val().trim().length==0)
  {
     alert("请输入验证码!");
     code.focus();
     return;
  }
    $.ajax({
     type:'post',
     url:basePath+'member/checkCode.action?code='+code.val(),
     success:function(msg)
     {
         var a=eval('('+msg+')');
         if(!a['result'])
         {
            alert('验证码输入错误!')
         }else{
  				document.forms[0].submit();
         }
     }
  });
}
function  loadCode()
{
   var img =$("#img");
   img.attr("src","<%=basePath%>web/register/yanzhengma.jsp?date="+new Date());
}
function changeV(v){
	$("#districtId").val(v);
}
function onreset1(){
	$("#phone").val(($("#Hphone").val()));
	$("#idcard").val(($("#Hidcard").val()));
}

function zhuxiao(){
	deleteCookie("userName","/");
	deleteCookie("password","/");
	deleteCookie("chkRememberMe","/");
    window.location.href="<%=basePath%>user/qiantanExit.action";
}
</script>
<link href="../web/resources/css/huiyuan1.css" rel="stylesheet" type="text/css" />
</head>

<body>
<jsp:include page="../top.jsp"></jsp:include>
 <form action="../member/updateMember.action" method="post">
<div class="hy-wr" align="center">

<div id="lib_zzjs_1"><img src="../web/resources/images/huiyuan_03.jpg" width="5" height="44" style=" float:left"/>
<div class="lib_menu_zzjsnet ">
<ul>
   <li id="zzjs_11" onclick="settab_zzjsnet('zzjs_1',1,6)" class="hover"><a href="#"><font color="#000">会员信息管理</font></a></li>
   <li id="zzjs_12" onclick="settab_zzjsnet('zzjs_1',2,6)"><a href="<%=basePath%>question/findInfoList.action?id=${userInfo.id}">发布求诊信息</a></li>
   <li id="zzjs_13" onclick="settab_zzjsnet('zzjs_1',3,6)"><a href="<%=basePath%>tiCase/searchMemberCase.action?idCard=${userInfo.id}">我的病历</a></li>
   <li id="zzjs_14" onclick="settab_zzjsnet('zzjs_1',4,6)"><a href="<%=basePath%>stage/dyHelp.action">导医信息</a></li>
   <li id="zzjs_15" onclick="settab_zzjsnet('zzjs_1',5,6)"><a href="<%=basePath%>web/mem/passwordModify.jsp">修改密码</a></li>
   <li id="zzjs_16" onclick="settab_zzjsnet('zzjs_1',6,6)"><a href="javascript:zhuxiao();">安全注销</a></li>
</ul>
</div><img src="../web/resources/images/huiyuan_08.jpg" width="5" height="44" style="float:left"/>
</div>

<div class="lib_Contentbox_zzjs">
<div id="zzjs_zzjs_1_1">
  <div class="qiehuan"><ul><li><a href="<%=basePath%>member/showMemInfo.action">基本信息</a></li><li><a href="#">信息修改</a></li></ul></div>
  <div class="cont">
    <div class="item"> <span class="label"><strong>电子邮箱：</strong></span> <span class="label">${tmMember.email}</span></div>
    <div class="item"> <span class="label"><strong>手机号码：</strong></span> <span class="input1"><input type="text" id="phone" value="${tmMember.phone}" name="tmMember.phone"/></span></div>
    <div class="item"> <span class="label"><strong>所在城市：</strong></span>
    <span class="input1">
      <select name="bigCategory" onchange="bigCategoryChange()" id="bigCategory">
				<s:iterator value="#proList" var="pdata" >
					<option value="<s:property value="#pdata.id"/>" 
					<s:if test='%{#pdata.id == #proviceId}'>
					selected="selected"
					</s:if>
					><s:property value="#pdata.name"/></option>
				</s:iterator>
	  </select>
      </span> 
      <span class="input1" id="smallCategory">
        <select id="districtIdsel" onchange="changeV(this.value)">
				<s:iterator value="#cityList" var="cdata">
					<option value="<s:property value="#cdata.id"/>" 
					<s:if test='%{#cdata.id == #cityId}'>
					selected="selected"
					</s:if>
					><s:property value="#cdata.name"/></option>
				</s:iterator>
			</select>
      </span>
	<input type="hidden" id="id" value="${tmMember.temId}" name="tmMember.temId"/>
	<input type="hidden" id="realName" value="${tmMember.realName}" name="tmMember.realName"/>
	<input type="hidden" id="email" value="${tmMember.email}" name="tmMember.email"/>
	<input type="hidden" id="loginId" value="${tmMember.loginId}" name="tmMember.loginId"/>
	<input type="hidden" id="districtId" value="${tmMember.districtId}" name="tmMember.districtId"/>
	
	<input type="hidden" id="Hphone" value="${tmMember.phone}"/>
	<input type="hidden" id="Hidcard" value="${tmMember.idcard}"/>
      </div>
      <div class="item">
        <span class="label"><strong>身份证号：</strong></span>
          <span class="input1"><input type="text" id="idcard" name="tmMember.idcard" value="${tmMember.idcard}"/></span></div>
    <div class="item"><span class="label"><strong>验 证 码：</strong></span>

      <span class="input2">
      <input type="text"  id="code" maxlength="4" /></span>
       <span><img id="img" src="<%=basePath%>web/register/yanzhengma.jsp" width="65" height="26" /></span>
    <span>&nbsp;看不清？</span><span><a href="javascript:loadCode()">换一张</a></span></div>
    
     <div class="item">
       <div class="btn-img" style="cursor: pointer;" onclick="onreset1();">重 &nbsp;置</div><div class="btn-img" style="cursor: pointer;" onclick="checkSubmit1();">提 &nbsp;交</div>
     </div> 
  </div></div>
<div id="zzjs_zzjs_1_2"></div>
<div id="zzjs_zzjs_1_3"></div>
<div id="zzjs_zzjs_1_4"></div>
<div id="zzjs_zzjs_1_5"></div>
<div id="zzjs_zzjs_1_6"></div>
</div>
<div class="lib-contentbox-zzjsbot"></div>
</div>
  </form>
<div class="sear3but"><span><strong>快捷导航：</strong></span><a href="<%=basePath %>stage/showHosAll.action">医院检索大全</a> <a href="<%=basePath %>stage/toCase.action">病历填写帮助</a> <a href="<%=basePath %>stage/toDy.action">导医服务</a></div>

<div class="foot">
<p>
					<a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage(window.location.href);" href="javascript:;">把网站设为主页</a> &nbsp;&nbsp;&nbsp;
					<a href="javascript:window.external.addFavorite(window.location.href,'医生在线');">把网站添加到收藏夹</a>
				</p>
				<p>
					<a href="<%=basePath%>aboutus/show.action?id=1">关于我们</a> |
					<a href="<%=basePath%>aboutus/show.action?id=1">About US</a>
				</p>
				<p>
					<a href="#">&copy;2012 备案号：京ICP证xxxxxxx号</a>
				</p>
</div>
</body>
</html>
